]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceThumbnail: handle scroll-event internally
authorTanner Doshier <doshitan@gmail.com>
Wed, 25 Jul 2012 20:15:26 +0000 (15:15 -0500)
committerCosimo Cecchi <cosimoc@gnome.org>
Mon, 17 Dec 2012 12:24:25 +0000 (13:24 +0100)
Instead of having WorkspacesDisplay calling us.

https://bugzilla.gnome.org/show_bug.cgi?id=690175

js/ui/workspaceThumbnail.js
js/ui/workspacesView.js

index d543f2bdfec6eac40f777512380a917b48a6c9e6..71ea13d3fa4c70d5984d76cc4707751558a95a05 100644 (file)
@@ -544,6 +544,7 @@ const ThumbnailsBox = new Lang.Class({
 
         this.actor.connect('button-press-event', function() { return true; });
         this.actor.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
+        this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
 
         Main.overview.connect('item-drag-begin',
                               Lang.bind(this, this._onDragBegin));
@@ -1203,5 +1204,16 @@ const ThumbnailsBox = new Lang.Class({
                            },
                            onCompleteScope: this
                          });
+    },
+
+    _onScrollEvent: function (actor, event) {
+        switch (event.get_scroll_direction()) {
+        case Clutter.ScrollDirection.UP:
+            Main.wm.actionMoveWorkspace(Meta.MotionDirection.UP);
+            break;
+        case Clutter.ScrollDirection.DOWN:
+            Main.wm.actionMoveWorkspace(Meta.MotionDirection.DOWN);
+            break;
+        }
     }
 });
index bd11076d967ba96d00d957ee14e8d44b908221e0..781c0e415ea7469127831af236f8f78a0f8dae5b 100644 (file)
@@ -493,8 +493,6 @@ const WorkspacesDisplay = new Lang.Class({
         controls.track_hover = true;
         controls.connect('notify::hover',
                          Lang.bind(this, this._onControlsHoverChanged));
-        controls.connect('scroll-event',
-                         Lang.bind(this, this._onScrollEvent));
 
         this._primaryIndex = Main.layoutManager.primaryIndex;
 
@@ -1013,17 +1011,6 @@ const WorkspacesDisplay = new Lang.Class({
         // might as well avoid it.
         Meta.later_add(Meta.LaterType.BEFORE_REDRAW,
                        Lang.bind(this, this._updateZoom));
-    },
-
-    _onScrollEvent: function (actor, event) {
-        switch ( event.get_scroll_direction() ) {
-        case Clutter.ScrollDirection.UP:
-            Main.wm.actionMoveWorkspace(Meta.MotionDirection.UP);
-            break;
-        case Clutter.ScrollDirection.DOWN:
-            Main.wm.actionMoveWorkspace(Meta.MotionDirection.DOWN);
-            break;
-        }
     }
 });
 Signals.addSignalMethods(WorkspacesDisplay.prototype);